package fr.afcepf.atod12.afcepfvoyage.beans;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Transient;


// Il s'agit de la classe Prestation du diagramme de classe "BoVoyage2.png"
@Entity
@Table(name="Offre")
public class Offre implements Serializable{
	@Transient
	private static final long serialVersionUID = 1L;
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	private Long idOffre;
	private Date dateDepart;
	private Date dateArrivee;
	private Double prix;
	@ManyToMany(fetch=FetchType.LAZY, mappedBy="offre")
	private List<Transport> transports;
	@OneToOne
	private Destination destination;
	@OneToOne
	private Formule formule;
	@ManyToMany(fetch=FetchType.LAZY, mappedBy="offre")
	private List<Hebergement> hebergements;
	public Offre(){
	}
	public final Long getIdOffre() {
		return idOffre;
	}
	public final void setIdOffre(Long idOffre) {
		this.idOffre = idOffre;
	}
	public final Date getDateDepart() {
		return dateDepart;
	}
	public final void setDateDepart(Date dateDepart) {
		this.dateDepart = dateDepart;
	}
	public final Date getDateArrivee() {
		return dateArrivee;
	}
	public final void setDateArrivee(Date dateArrivee) {
		this.dateArrivee = dateArrivee;
	}
	public final Double getPrix() {
		return prix;
	}
	public final void setPrix(Double prix) {
		this.prix = prix;
	}
	public final Destination getDestination() {
		return destination;
	}
	public final void setDestination(Destination destination) {
		this.destination = destination;
	}
	public final Formule getFormule() {
		return formule;
	}
	public final void setFormule(Formule formule) {
		this.formule = formule;
	}
	public final List<Transport> getTransports() {
		return transports;
	}
	public final void setTransports(List<Transport> transports) {
		this.transports = transports;
	}
	public final List<Hebergement> getHebergements() {
		return hebergements;
	}
	public final void setHebergements(List<Hebergement> hebergements) {
		this.hebergements = hebergements;
	}
}

